********************************************************************************
***
*** 	Replication files for Zhuang, Maiting. 2022.
***
*** 	"Intergovernmental Conflict and Censorship: Evidence from China's 
***
***		Anti-Corruption Campaign" 
***
***		Journal of the European Economic Association
***
********************************************************************************

*** 	Do-file for all Tables and Figures in Appendix C

clear

global dir "your directory path"
cd "$dir"

********************************************************************************

*** FIGURE C.2

use  "$dir/data/of_articles.dta"

lpoly topic1 date_diff if date_diff>=-360 & date_diff<=360,msize(tiny) mcolor(gs10) xsc(r(-360(30)360)) xlabel(-360(120)360) kernel()  lineopts(lcolor(black) lpattern(solid)) ///	
	ytitle("Probability that article is about corruption",margin(medium)) xtitle("Days since investigation announcement",margin(medium)) ///
	title("") scheme(s1mono) legend(off) note("")
graph export "$dir/output/FigureC2.pdf", replace


********************************************************************************

*** FIGURE C.3

use  "$dir/data/articles.dta",clear

preserve 

bys week_diff group: egen l_articlesbal = mean(art_articles_bal)

duplicates drop week_diff group, force

twoway line l_articlesbal date_diff if group==3 & date_diff>=-700 & date_diff<=400, lcolor(black)  || line l_articlesbal date_diff if group==4 &date_diff>=-700 & date_diff<=400, lcolor(gs10) lpattern(dash) ///
||, xsc(r()) xlabel(#10) scheme(s1mono) xtitle("Days since investigation announcement") ytitle("Balance of positive minus negative words") legend(label(1 "Same province")label( 2 "Other province"))
graph export "$dir/output/FigureC3.pdf",replace

restore 

